package 上课day1;

import java.sql.Struct;
import java.util.ArrayList;
import java.util.HashSet;

public class project_demo5 {
	public static void main(String[] args) {
ArrayList<String> arrayList1 = new ArrayList<>();
		
		String str1 = new String("张三");
		String str2 = new String("李四");
		String str3 = new String("王五");
		String str4 = new String("刘柳");
		String str5 = new String("李琦");
		
		String str6 = new String("王八");
		
		arrayList1.add(str1);
		arrayList1.add(str2);
		arrayList1.add(str3);
		arrayList1.add(str4);
		arrayList1.add(str5);
		arrayList1.add(str1);
		arrayList1.add(str2);
		arrayList1.add(str3);

		for (String string : arrayList1) {
			System.out.println(string);
		}
		System.out.println();
		
		ArrayList<Student> arrayList2 = new ArrayList<>();
		
		Student stu1 = new Student(11, "张三");
		Student stu2 = new Student(12, "李四");
		Student stu3 = new Student(13, "王五");
		Student stu4 = new Student(14, "刘柳");
		Student stu5 = new Student(15, "李琦");
		
		arrayList2.add(stu1);
		arrayList2.add(stu2);
		arrayList2.add(stu3);
		arrayList2.add(stu4);
		arrayList2.add(stu5);
		
		for (Student student : arrayList2) {
			System.out.println(student.getName() + "     " + student.getAge());
		}
	}
}
